package com.bjsdzk.collector.entity.response;

/**
 * @author sl
 */
public class ResultHandler {

    public static <T> Result ok(T t) {
        return new Result(t);
    }

    public static Result ok() {
        return new Result("");
    }

    public static Result error(ResultCode error) {
        return new Result(error.getCode(), error.getMsg());
    }

    public static <K> Result<K> error(ResultCode error, K k) {
        return new Result<K>(error.getCode(), error.getMsg(), k);
    }

    public static <K> Result<K> error(Integer code, String msg, K k) {
        return new Result<K>(code, msg, k);
    }
    public static  Result error(Integer code, String msg) {
        return new Result(code, msg);
    }

}
